<?php

namespace App\Http\Controllers\Client\Member;

use App\Models\Member\Member;
use App\Http\Controllers\RootController as Controller;
use Illuminate\Http\Request;

class MembersController extends Controller
{
    public function handle(Request $request)
    {

        $query = Member::orderBy('id', 'desc');
        $query->where('org_id', $this->user()->org_id)->where('id', '!=', $this->id());

        $query->select(['id', 'name']);

        $rows = $query->get();

        return $this->success($rows);
    }
}
